package com.teach;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * <pre>
 * - 输出格式:2019年01月01日 周一 01时01分01秒
 * Author : J.L.Zhou
 * E-Mail : 2233875735@qq.com
 * Tel : 151 1104 7708
 * Date : 2021-4-16 11:04:42
 * Version : 1.0
 * Copyright 2021 jlzhou.top Inc. All rights reserved.
 * Warning: this content is only for internal circulation of the company.
 *          It is forbidden to divulge it or use it for other commercial purposes.
 * </pre>
 *
 */
public class Demo0303 {

	public static void main(String[] args) {
		System.out.println(format(new Date()));
		System.out.println(format(new Date(new Date().getTime()+24*60*60*1000)));
		System.out.println(format(new Date(new Date().getTime()+48*60*60*1000)));
	}
	
	public static String ws = " 日一二三四五六";
	
	public static String format(Date d) {
		Calendar c = Calendar.getInstance();
		c.setTime(d);
		SimpleDateFormat f = new SimpleDateFormat("yyyy年MM月dd日 周 HH时mm分ss秒");
		String str = f.format(d);
		return str.replace("周", "周"+ws.charAt(c.get(Calendar.DAY_OF_WEEK)));
	}
}
